package com.pmc.domain.student.service;

import com.alibaba.fastjson.JSON;
import com.pmc.domain.student.entity.Student;
import com.pmc.domain.student.repository.StudentRepository;
import com.pmc.domain.student.vo.StudentQueryVO;
import com.pmc.domain.student.vo.StudentVO;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * StudentService
 *
 * @author hudeng
 * @version 1.0
 * @description 学生服务
 * @date 2024/7/4 10:13
 */
@Service
public class StudentService {

    @Autowired
    private StudentRepository studentRepository;

    public List<StudentVO> queryList(StudentQueryVO queryVO) {
        List<Student> students = studentRepository.queryList(queryVO);
        return JSON.parseArray(JSON.toJSONString(students), StudentVO.class);
    }
}
